package com.woniu40.petai_manager.service;

import com.woniu40.petai_manager.entity.GoodsType;
import com.woniu40.petai_manager.mapper.GoodsTypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsTypeService {

    @Autowired
    GoodsTypeMapper goodsTypeMapper;

    public List<GoodsType> findAllGoodsType(){
        return goodsTypeMapper.selectAll();
    }

    public GoodsType findById(Integer goodsTypeId) {
        return goodsTypeMapper.selectById(goodsTypeId);
    }

    public int addGt(GoodsType goodsType) {
        return goodsTypeMapper.insert(goodsType);
    }

    public int modifyGt(GoodsType goodsType) {
        return goodsTypeMapper.updateGt(goodsType);
    }

    public int removeByIds(List<Integer> idList) {
        return goodsTypeMapper.deleteByIds(idList);
    }

    public int removePro(Integer id) {
        return goodsTypeMapper.deleteById(id);
    }
}
